// 测试struct
package main

import "fmt"

type address struct {
	province string
	city     string
}

type student struct {
	sname string
	address
}

func printTeacher(t *teacher) {
	fmt.Println("print a teacher:")
	fmt.Println(t.tname)
	fmt.Println(t.taddress.province)
	fmt.Println(t.taddress.city)
}

type teacher struct {
	tname    string
	taddress address
}

func main() {
	var s01 student
	s01.sname = "peiss"
	s01.address.province = "henan"
	s01.address.city = "luoyang"

	fmt.Println(s01)

	t01 := teacher{tname: "wangda"}
	t01.taddress.province = "guangdong"
	t01.taddress.city = "guangzhou"

	printTeacher(&t01)
}
